package com.yun.zf.app.controller;

import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
import com.github.xiaoymin.knife4j.annotations.DynamicParameters;
import com.yun.zf.app.service.ZfCommunityService;
import com.yun.zf.common.admin.dto.community.CommunityDto;
import com.yun.zf.common.vo.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@Api(tags = "找小区")
@RequestMapping("/community")
public class CommunityController {
    @Autowired
    private ZfCommunityService communityService;


    @PostMapping("/communityDetail")
    @ApiOperation(value = "小区详情信息")
    @DynamicParameters(name = "SendOrderMapModel",properties = {
            @DynamicParameter(name = "communityId",value = "小区编号",example = "111",required = true)
    })
    public Response<CommunityDto> communityDetail(@RequestBody Map<String,String> map){
        return  Response.success( communityService.getDetailInfo(Long.parseLong(map.get("communityId"))));
    }
}
